package com.future.common.interceptor;

import com.future.common.global.PlatFormContext;
import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

public class MobileInterceptor implements Interceptor {

	@Override
	public void intercept(Invocation inv) {
		String fromMobile = inv.getController().getRequest().getHeader("Mobile");
		if (fromMobile != null && "true".equals(fromMobile)) {
			PlatFormContext.setFromMobile(true);
		} else {
			PlatFormContext.setFromMobile(false);
		}
		inv.invoke();
	}

}
